/**
 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package org.openwork.portlet.skillmanagement.model.impl;

import org.openwork.portlet.skillmanagement.model.Skill;
import org.openwork.portlet.skillmanagement.model.SkillCategory;
import org.openwork.portlet.skillmanagement.service.SkillCategoryLocalServiceUtil;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.model.Group;
import com.liferay.portal.service.GroupLocalServiceUtil;

/**
 * <a href="SkillImpl.java.html"><b><i>View Source</i></b></a>
 *
 * @author Samuel Garcia Martinez
 */
public class SkillImpl extends SkillModelImpl implements Skill {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1549349092157343208L;
	private static Log log = LogFactoryUtil.getLog(SkillImpl.class);
	
	public SkillImpl() {
	}
	
	public SkillCategory getSkillCategory() {
		try {
			return SkillCategoryLocalServiceUtil.getSkillCategory(getCategoryId());
		}
		catch (Exception e) {
			if (log.isWarnEnabled()) {
				log.warn("Unable to get category for skill " + getId());
			}
		}

		return null;
	}
}